import { http } from "@/utils/http";
import type { AxiosResultDefault, TreeDataType, TableItem, TableType } from "../type";

// 获取负荷数据
// export const getLoadDataAPI = data => {
//   return http.request("post", "/energy/energyOverview/queryLoad", {
//     data
//   });
// };

// 负荷状态列表
export const getListLoadStateAPI = data => {
  return http.request("post", "/energy/supplyLoad/listLoadState", {
    data
  });
};

// 获取获取量-金额-碳排放-折标煤
export const getQtyAmtAPI = data => {
  return http.request("post", "/energy/energyOverview/queryQtyAmtEcarbonScoal", {
    data
  });
};

// 获取能源用量趋势数据
export const getTrendAPI = data => {
  return http.request("post", "/energy/energyOverview/queryTrend", {
    data
  });
};

// 获取异常数据
export const getAlarmDataAPI = data => {
  return http.request("post", "/energy/consumptionMonitor/viewAlarmQty", {
    data
  });
};

// 获取产量数据
export const getProductDataAPI = data => {
  return http.request("post", "/energy/consumeMeasure/listProduction", {
    data
  });
};

// 风险与机遇 分页查询 列表
export const queryRiskOpportunityList = (data: object | undefined, cb?: (err: any) => any) =>
  http.request<AxiosResultDefault<TableType>>("post", `/energy/report/listOpportunity`, { data }, { headers: { noLoading: true } }, cb);

// 风险与机遇 删除
export const deleteRiskOpportunity = (data: object | undefined, cb?: (err: any) => any) =>
  http.request<AxiosResultDefault<TableType>>("post", `/energy/report/deleteOpportunity`, { data }, { headers: { noLoading: true } }, cb);

// 风险与机遇 查看详情
export const checkRiskOpportunityDetail = (data: object | undefined, cb?: (err: any) => any) =>
  http.request<AxiosResultDefault<TableType>>("post", `/energy/report/viewOpportunity`, { data }, { headers: { noLoading: true } }, cb);

// 风险与机遇 新增/编辑
export const addEditRiskOpportunity = (data: object | undefined, cb?: (err: any) => any) =>
  http.request<AxiosResultDefault<TableType>>("post", `/energy/report/updateOpportunity`, { data }, { headers: { noLoading: true } }, cb);
